package cn.invest.merry.module.invest.dal.mysql.gsbase;

import cn.invest.merry.framework.common.pojo.PageResult;
import cn.invest.merry.framework.mybatis.core.mapper.BaseMapperX;
import cn.invest.merry.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.invest.merry.module.invest.controller.admin.gsbase.vo.GsBasePageReqVO;
import cn.invest.merry.module.invest.dal.dataobject.gsbase.GsBaseDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 公司基本信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface GsBaseMapper extends BaseMapperX<GsBaseDO> {

    default PageResult<GsBaseDO> selectPage(GsBasePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<GsBaseDO>()
                .eqIfPresent(GsBaseDO::getSeccode, reqVO.getSeccode())
                .likeIfPresent(GsBaseDO::getSecname, reqVO.getSecname())
                .eqIfPresent(GsBaseDO::getF001v, reqVO.getF001v())
                .eqIfPresent(GsBaseDO::getF002v, reqVO.getF002v())
                .eqIfPresent(GsBaseDO::getF003v, reqVO.getF003v())
                .likeIfPresent(GsBaseDO::getF004v, reqVO.getF004v())
                .orderByDesc(GsBaseDO::getSeccode));
    }

}